def makeQSinputs(n):
    R = [['']]
    for x in range(n):
        Nu = []
        for prefix in R[-1]: 
            for extension in ['l','h']:
                form = '\#'+prefix[2:-3]+extension+'\#,'
                Nu.append(form)
        R += [Nu]
    Result = []
    for r in R[1:]:
        Result += r    
    return Result


for form in makeQSinputs(5): print form
    
    